package cn.adelyn.base.rbac.dao.mapper;

import cn.adelyn.base.rbac.pojo.model.UserTypePermissionModel;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author chengze
 * @date 2022/12/20
 * @desc 菜单资源
 */
@Mapper
public interface UserTypePermissionMapper extends BaseMapper<UserTypePermissionModel> {

    /**
     * 获取某个类型用户的权限列表
     * https://baomidou.com/pages/10c804/#lambda
     */
    @Select("select permission from usertype_permission ${ew.customSqlSegment}")
    List<String> listAllPermissionByUserType(@Param(Constants.WRAPPER) Wrapper wrapper);
}
